<?php

namespace app\admin\model;

use think\Model;

class AuthRule extends Model {

        protected function _after_select(&$resultSet, $options = array()) {
                parent::_after_select($resultSet, $options);
                foreach ($resultSet as $key => $value) {
                        $child_num = $this->where(array('pid' => $value['id']))->count();
                        $resultSet[$key]['child_num'] = $child_num;
                }
        }

}
